package mahjong.auto.com.os;

/**
 * Created by Administrator on 2017/8/12.
 */

public class UserBoard {
    private int[] mBoard = null;    //自己有的
    private int[] mOut = null;      //打出的
    private int[] mOpen = null;     //公开的
    private boolean mIsDealer = false; //是否是桩家
    private int mLackBoard = 0; //缺牌

    public EnumMahjong getLackBoard() {
        try {
            return EnumMahjong.values()[mLackBoard];
        } catch (Exception e) {
            return EnumMahjong.M_NONE;
        }
    }

    public void setLackBoard(int lackBoard) {
        this.mLackBoard = lackBoard;
    }

    public boolean ismIsDealer() {
        return mIsDealer;
    }

    public void setIsDealer(boolean mIsDealer) {
        this.mIsDealer = mIsDealer;
    }

    public EnumMahjong[] getBoard() {
        if (null == mBoard)
            return new EnumMahjong[0];

        EnumMahjong[] ret = new EnumMahjong[mBoard.length];
        for (int i = 0; i < ret.length; i++) {
            ret[i] = EnumMahjong.values()[mBoard[i]];
        }
        return ret;
    }

    public void setBoard(int[] mBoard) {
        this.mBoard = mBoard;
    }

    public EnumMahjong[] getOut() {
        if (null == mOut)
            return new EnumMahjong[0];

        EnumMahjong[] ret = new EnumMahjong[mOut.length];
        for (int i = 0; i < ret.length; i++) {
            ret[i] = EnumMahjong.values()[mOut[i]];
        }
        return ret;
    }

    public void setOut(int[] mOut) {
        this.mOut = mOut;
    }

    public EnumMahjong[] getOpen() {
        if (null == mOpen)
            return new EnumMahjong[0];

        EnumMahjong[] ret = new EnumMahjong[mOpen.length];
        for (int i = 0; i < ret.length; i++) {
            ret[i] = EnumMahjong.values()[mOpen[i]];
        }
        return ret;
    }

    public void setOpen(int[] mOpen) {
        this.mOpen = mOpen;
    }
}
